<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/webCommon/webCommon.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>任务修改</title>
<script type="text/javascript" src="plugins/layui/layui.js"></script>
<!-- 默认选中分组名称-开始 -->
<script type="text/javascript" >
 $(document).ready(function(){
		$(".studentGroupIdSelect").each(function(){//循环获取所有分组编号 
			var studentGroupId = $(this).attr("value");
			var studentGroup = $("#serviceTaskStudentGroupId").attr("value");
			if(studentGroupId == studentGroup){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>

<!-- 默认选中学题目名称-结束 -->
<!-- 默认选中指派人名称-开始 --> 
<script type="text/javascript" >
 $(document).ready(function(){
		$(".userIdSelect").each(function(){//循环获取所有分组编号 
			var userId = $(this).attr("value");
			var user = $("#serviceTaskUserId").attr("value");
			if(userId == user){
				$(this).attr("selected","selected");				
		}	
		});
	 });
</script>
<!-- 默认选中学指派人名称-结束 -->

<script type="text/javascript" src="plugins/layui/layui.js"></script>
		<script>
			layui.use(['form', 'layedit', 'laydate'], function() {
				var form = layui.form(),
					layer = layui.layer,
					layedit = layui.layedit,
					laydate = layui.laydate;
				 //监听提交
				form.on('submit(tijiao)', function(data) {
					layer.alert(JSON.stringify(data.field), {
						title: '最终的提交信息'
					})
				});
			});
		</script>

</head>

<body>
	<div class="place">
	    <span>位置：</span>
	    <ul class="placeul">
	    <li><a href="#">首页</a></li>
	    <li><a href="#">任务管理</a></li>
	    <li><a href="#">编辑任务信息</a></li>
	    </ul>
	    </div>
	    
	<div style="margin: 15px;">
		 <form class="layui-form" action="<%=basePath%>/sys/ServiceTask_edit.action">
		 <input name="id"  type="hidden" value="${serviceTask.id}">
		 <input name="taskId"  type="hidden" value="${serviceTask.taskId}">
			<div class="layui-form-item">
				<label class="layui-form-label">任务名称</label>
				<div class="layui-input-inline">
					<input type="text" name="taskName" lay-verify="taskName" autocomplete="off" value="${serviceTask.taskName }" class="layui-input">
				</div>
			</div>
				<div class="layui-form-item">
					<label class="layui-form-label">分组名称</label>
				<div class="layui-input-inline">
						<select name="studentGroupId" id="studentGroupId">
							<option value="">请选择...</option>
							<s:iterator value="serviceStudentGroupAllList">
							<option class="studentGroupIdSelect" value="${studentGroupId}" id="${studentGroupId}">${studentGroupName}</option>
							</s:iterator>
						</select>
					</div>
				</div>
					
			<div class="layui-form-item">
				<label class="layui-form-label">任务内容</label>
				<div class="layui-input-block">
					<input type="text" class="layui-textarea" name="taskContent" lay-verify="taskContent" autocomplete="off" value=${serviceTask.taskContent } />

				</div>
			</div>
				<div class="layui-form-item">
				<label class="layui-form-label">任务结束时间</label>
				<div class="layui-input-inline" id="workStartTime">
					<input type="text" name="taskStateTime" id="taskStateTime" lay-verify="taskStateTime" placeholder="YYYY-MM-DD hh:mm:ss" value="${serviceTask.taskStateTime}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: taskStateTime,istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
				</div>
			</div>
		     <div class="layui-form-item">
				<label class="layui-form-label">任务结束时间</label>
				<div class="layui-input-inline" id="taskFinishTime">
					<input type="text" name="taskFinishTime" id="taskFinishTime" lay-verify="taskFinishTime" placeholder="YYYY-MM-DD hh:mm:ss" value="${serviceTask.taskFinishTime}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: taskFinishTime,istime: true,format: 'YYYY-MM-DD hh:mm:ss'})">
				</div>
			</div>
			<div class="layui-form-item">
					<div class="layui-input-block">
						<button id="tijiao" class="layui-btn" lay-filter="tijiao" lay-submit="">立即提交</button>
						<a href="<%= basePath%>/sys/ServiceTask_cancelTask.action?taskId=${taskId}" class ="layui-btn"><i class="layui-icon">&#xe608;</i>任务取消</a>
						<button type="reset" class="layui-btn layui-btn-primary">重置</button>
					</div>
				</div>
				</form>
		 <input name="serviceTask.studentGroupId" type="hidden" id="serviceTaskStudentGroupId" value="${serviceTask.studentGroupId }"/>  <!-- 用于下拉选择的读取-分组 -->
		 <input name="serviceTask.userId" type="hidden" id="serviceTaskUserId" value="${serviceTask.userId }"/>  <!-- 用于下拉选择的读取-分组 -->
</body>
</html>
